package com.ludomancy.starwave;

import java.awt.Graphics;
import java.awt.Point;
import java.util.Vector;

public class MineShip extends Ship
{

	public MineShip(Player owner, int px, int py)
	{
		super(owner, px, py);
		type = MIN;
	}
	
	protected Point[] getFiringArc()
	{
		return new Point[0];
	}
	
	public boolean isShooter()
	{
		return false;
	}
	
	public Vector attack()
	{
		Vector enemies = super.attack();
		if(!enemies.isEmpty())
		{
			receiveAttack(1.0);
		}
		return new Vector();
	}
	
	public boolean collide(Ship other, Vector animations)
	{
		other.receiveAttack(1.0);
		receiveAttack(1.0);
		animations.add(0, new ExplosionAnimation(this));
		return true;
	}
	
	public void paintDead(Graphics g, int x, int y)
	{
		// mines leave no corpse
	}
	
	protected void receiveAttack(double damage)
	{
		hull = 0;
		
	}
	
	public boolean isSolid()
	{
		return false;
	}
	
	public boolean isMover()
	{
		return false;
	}

	protected boolean canMove()
	{
		return false;
	}

	public String getDescription()
	{
		return "Mine destroys anything that bumps into it";
	}
}
